<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="renderer" content="webkit">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>车辆资产信息</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body>
		<form id="prj_cst_ass_mb_Info_oth_form">
             <div class="fieldset1 tabel_col tabel_col_s clearFix noBorder">
                <div class="fieldBox col_50">
                    <div class="label">资产名称</div>
                    <div class="field">
                        <input name="assNm" id="assNm" type="text" class="ui-textbox" value="${prjCstAssMbInfo.assNm}" validate="{required:true}">
                         <span class="requiredSymbol">*</span>
                    </div>
                </div>
                  <div class="fieldBox col_50" >
                    <div class="label">估值(万元)</div>
                    <div class="field">
                        <input name="value" id="value" type="text" class="ui-textbox" value="${prjCstAssMbInfo.value}" data-tofix="2" validate="{required:true,number:true}">
                          <span class="requiredSymbol">*</span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">财产状况</div>
                    <div class="field">
                        <input name="assSts" id="assSts" type="text" class="ui-textbox" value="${prjCstAssMbInfo.assSts}" validate="{required:true}">
                         <span class="requiredSymbol">*</span>
                    </div>
                </div>
                   <div class="fieldBox col_50">
                    <div class="label">所有权人</div>
                    <div class="field">
                        <input name="assOwner" id="assOwner" type="text" class="ui-textbox" value="${prjCstAssMbInfo.assOwner}" validate="{required:true}">
                         <span class="requiredSymbol">*</span>
                    </div>
                </div>
                 <div class="fieldBox col_50">
                                <div class="label">与申请人关系</div>
                                <div class="field">
                                <select name="assRlCd"  id="assRlCd" >
                                <option value="  ">---请选择---</option>
                                <c:forEach items="${assRlCdList}" var="opt">
                                 <option value="${opt.key}"
                                 <c:if test="${opt.key==prjCstAssMbInfo.assRlCd }">selected="selected"</c:if>
                                 >${opt.value}</option>
                                </c:forEach>
                                </select>
                                </div>
                    </div>
                <div class="fieldBox col_50">
                    <div class="label">购买时间</div>
                    <div class="field">
                        <input name="purchDt" id="purchDt" type="text" class="ui-datepicker" value="${prjCstAssMbInfo.purchDt}">
                    </div>
                </div>
             <%--    <div class="fieldBox col_100">
                    <div class="label">备注</div>
                    <div class="field" style="width: 100%;">
                        <textarea name="assRem" id="assRem" rows="4" class="l-textarea" style="width:99%">${prjCstAssMbInfo.assRem}</textarea>
                    </div>
                </div> --%>
            </div>
            <!-- hide data -->
	        <div class="fieldBox col_100" style="display:none;">
	          <div class="field">
	             	<input name="assMbInfoId" id="assMbInfoId" type="text" class="ui-textbox" value="${prjCstAssMbInfo.id}">
	          </div>
	        </div>
            <div class="btnsBox">
                <span id="prj_cst_ass_mb_Info_oth_form_add_btn_id" class="sq-button sq-button-round"><!-- <i class="sqBtnIco_10"></i> -->保存</span>
                <span id="prj_cst_ass_mb_Info_oth_form_cancel_btn_id" class="sq-button sq-button-round"><!-- <i class="sqBtnIco_14"></i> -->取消</span>
            </div>
        </form>
	<script>
		var prjId ='${prjId}';
		var cstId ='${cstId}';
		var cstRlCd ='${cstRlCd}';
		$(function() {
		
			var purchDt = $("#purchDt").val();
		   $("#prj_cst_ass_mb_Info_oth_form").ligerForm({
                validate: true
           });
			if(null != purchDt&&purchDt!=''){
				var date = new Date(purchDt);
				$("#purchDt").val(DateUtils.formatDate(date, DateUtils.YYYY_MM_DD));
			}
		   
		    $("#prj_cst_ass_mb_Info_oth_form_add_btn_id").click(function(event) {
	            var ligerForm = liger.get("prj_cst_ass_mb_Info_oth_form");
	            if (!ligerForm.valid()) {
	                top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
	                return false; //验证不通过，不执行以下代码
	            }
	            var data = ligerForm.getData();
	            data["purchDt"] = $("#purchDt").val();
	            var url = '<%=path%>/project/prjcstassmbInfo/add.do';
	            data["id"]= $("#assMbInfoId").val();
	            data["prjId"] =prjId;
	            data["cstId"]= cstId;
	            data["cstRlCd"] = cstRlCd
	            data["assPropCd"]=ProjectConstant.CST_ASS_PROP_OTH_CD;
	            var wait_dialog;
	            $.ajax({
	        		type: 'post',
	        		dataType:'json',
	        		data:data,
	        		url: url,
	        		beforeSend: function(){
		  		          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		  		     },
	        		success:function(msg){
	        			 wait_dialog.close();
	        			 if(msg.success == 1){
	        				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
	        				 parent.otherGrid.reload();
	        				 frameElement.dialog.close();
	        			 }else{
	        				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
	        			 }
	        		}
	        	});
	        });
	        
	        //取消
	        $("#prj_cst_ass_mb_Info_oth_form_cancel_btn_id").click(function(event) {
	        	frameElement.dialog.close();
	        });
	        
		});
		
	</script>

</body>
</html>